package cn.yunhe.back.controller;


import cn.yunhe.back.service.TUserService;
import cn.yunhe.entity.TUser;


/*import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;*/
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 代码生成器(自动生成LF)
 * @since 2019-06-12
 */
@RestController
public class TUserController {

    @Resource
    private TUserService TUserService;

    @RequestMapping("/toUser")
    public ModelAndView toShow() {
        return new ModelAndView("userlist");
    }

    @RequestMapping("/getUserList")
    public Page<TUser> getUserList(String pageNum,String pageSize,TUser tUser){
        return TUserService.getUserByPage(pageNum,pageSize,tUser);
    }
    @RequestMapping("/del")
    public int delUser(TUser tUser){
        tUser.setState(1);
        return TUserService.updateById(tUser);
    }
    @RequestMapping("/uCount")
    public int count(){
        return TUserService.selectCount();
    }


}
